package com.google.code.garbagecan.jettystudy.sample5;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.ContextHandler;

public class SimpleContextServer {
	public static void main(String[] args) throws Exception {
		Server server = new Server(8080);

		// http://localhost:8080/myapp
		ContextHandler context = new ContextHandler();
		context.setContextPath("/myapp");
		context.setResourceBase(".");
		context.setClassLoader(Thread.currentThread().getContextClassLoader());
		server.setHandler(context);

		context.setHandler(new MyHandler());

		server.start();
		server.join();
	}
}
